# -*- coding: utf-8 -*-
# @Time     : 2021/11/26 16:09
# @Author   : wljess
# @File     : 框架路由传参.py
# @Describe : 
# @Software : PyCharm

URL_CONF = {}


def route(url):
    def set_func(func):
        URL_CONF[url] = func

        def inner(*args, **kwargs):
            return func(*args, **kwargs)
        return inner

    return set_func


@route('index.py')
def index():
    return "欢迎访问首页页面"


@route("register.py")
def register():
    return "欢迎来到注册页面"


def application(file_name):
    func = URL_CONF[file_name]

    return func


if __name__ == '__main__':
    app1 = application("index.py")
    app2 = application("register.py")
    print(app1())
    print(app2())
